<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }
    
    body {
        background: url(images/bj0.jpg) no-repeat center top;
    }
    
    li {
        list-style: none;
    }
    
    .box {
        overflow: hidden;
        width: 416px;
        height: 54px;
        background-color: #fff;
        margin: 100px auto;
    }
    
    .box li {
        float: left;
        width: 100px;
        height: 50px;
        margin: 2px;
        cursor: pointer;
    }
    
    .box img {
        width: 100%;
        height: 100%;
    }
</style>

<body>
    <ul class="box">
        <li><img src="images/bj1.jpg" alt=""></li>
        <li><img src="images/bj2.jpg" alt=""></li>
        <li><img src="images/bj3.jpg" alt=""></li>
        <li><img src="images/bj4.jpg" alt=""></li>
    </ul>
    <script>
        var imgs = document.querySelector('.box').querySelectorAll('img');
        for (var i = 0; i < imgs.length; i++) {
            imgs[i].onclick = function() {
                document.body.style.backgroundImage = 'url(' + this.src + ')';
            }
        }
    </script>
</body>

</html>